'use strict';
const _0x527d = [
    'Message',
    'egRfC',
    'electron.h',
    'ui-kit:tou',
    '543990lQJeGO',
    'show',
    'wYLwo',
    ':focusNode',
    'OjTNI',
    'existsSync',
    'ready-to-s',
    'loadURL',
    'IHhew',
    'ch-asset',
    'SCSvp',
    'Sec',
    'eadei',
    'electron',
    'query-port',
    'select',
    'name',
    'index_low_',
    '../cocos-i',
    '456539uEQzen',
    './package.',
    'versions',
    ':focusAsse',
    'utf-8',
    'how',
    'closed',
    'node',
    'd.js',
    'VSdBg',
    'LIPUQ',
    'zEqPJ',
    'readFileSy',
    'broadcast',
    'onfig.json',
    '380253HhzOvy',
    'APVZL',
    'webContent',
    'config.jso',
    'Cocos\x20Insp',
    '721661XjLuZN',
    'removeAllL',
    'vnfCD',
    'hUxUn',
    'unselect',
    'cZiqy',
    'server',
    'pEjRA',
    'json',
    'tml',
    '13knDpGX',
    'setMenu',
    'cERxr',
    '&mode=',
    '128272FooXOu',
    '#2e2c29',
    'error',
    'aScript',
    'process',
    'FYVCW',
    'UTJIn',
    '486093uyfKgA',
    'disableWeb',
    'v.switchMo',
    'isteners',
    'getSelecte',
    '?port=',
    'index.html',
    '1KeYEcf',
    'de(',
    'request',
    'nspector-c',
    'KULGN',
    'OOEZE',
    'file://',
    'mainPreloa',
    'split',
    'executeJav',
    'asset',
    'parse',
    '1hvhHdr',
    'ector\x20v',
    'exports',
    'GrcYt',
    'gmHrg',
    'Selection',
    '20036FzfpiH',
    'path',
    'oBAgH',
    'join',
    'version'
];
const _0x4386fd = _0x11c1;
(function (_0x5b2b36, _0x43e888) {
    const _0x55db43 = _0x11c1;
    while (!![]) {
        try {
            const _0x281b6a = parseInt(_0x55db43(0x199)) * parseInt(_0x55db43(0x15c)) + -parseInt(_0x55db43(0x14a)) * -parseInt(_0x55db43(0x16e)) + parseInt(_0x55db43(0x14e)) + parseInt(_0x55db43(0x18a)) + parseInt(_0x55db43(0x140)) * parseInt(_0x55db43(0x168)) + -parseInt(_0x55db43(0x177)) + -parseInt(_0x55db43(0x155));
            if (_0x281b6a === _0x43e888)
                break;
            else
                _0x5b2b36['push'](_0x5b2b36['shift']());
        } catch (_0xdc045f) {
            _0x5b2b36['push'](_0x5b2b36['shift']());
        }
    }
}(_0x527d, 0x31232 + -0x1d * -0x945b + -0x1f * 0x3095));
const {BrowserWindow, app, remote, ipcMain} = require(_0x4386fd(0x184)), path = require(_0x4386fd(0x16f)), pcs = require(_0x4386fd(0x152)), folder = '', devTools = ![];
let win, mode = -0x2299 + -0x29 * -0x11 + -0x11 * -0x1e0, unloaded = ![];
function _0x11c1(_0x59742d, _0x84e4f) {
    _0x59742d = _0x59742d - (-0x685 * 0x2 + -0x1 * -0x1a17 + -0xbcd);
    let _0x6148e1 = _0x527d[_0x59742d];
    return _0x6148e1;
}
const PKG_NAME = require(_0x4386fd(0x18b) + _0x4386fd(0x148))[_0x4386fd(0x187)], PKG_VERSION = require(_0x4386fd(0x18b) + _0x4386fd(0x148))[_0x4386fd(0x172)];
let fs = require('fs'), _configPath = path[_0x4386fd(0x171)](__dirname, _0x4386fd(0x19c) + 'n'), __parentConfig = path[_0x4386fd(0x171)](__dirname, _0x4386fd(0x189) + _0x4386fd(0x15f) + _0x4386fd(0x198));
function readConfig() {
    const _0x3c7af0 = _0x4386fd, _0x81eb92 = { 'APVZL': _0x3c7af0(0x18e) };
    let _0x379288 = '';
    return fs[_0x3c7af0(0x17c)](__parentConfig) ? _0x379288 = fs[_0x3c7af0(0x196) + 'nc'](__parentConfig, { 'encoding': _0x81eb92[_0x3c7af0(0x19a)] }) : _0x379288 = fs[_0x3c7af0(0x196) + 'nc'](_configPath, { 'encoding': _0x81eb92[_0x3c7af0(0x19a)] }), JSON[_0x3c7af0(0x167)](_0x379288);
}
let disableWebSec = Boolean(readConfig()[_0x4386fd(0x156) + _0x4386fd(0x182)]);
module[_0x4386fd(0x16a)] = {
    async 'load'() {
        const _0x59c6fd = _0x4386fd;
        ipcMain['on'](PKG_NAME + _0x59c6fd(0x17a), focusNode), ipcMain['on'](PKG_NAME + (_0x59c6fd(0x18d) + 't'), focusAsset);
    },
    'unload'() {
        const _0x5b2068 = _0x4386fd;
        unloaded = !![], ipcMain[_0x5b2068(0x141) + _0x5b2068(0x158)](PKG_NAME + _0x5b2068(0x17a)), ipcMain[_0x5b2068(0x141) + _0x5b2068(0x158)](PKG_NAME + (_0x5b2068(0x18d) + 't'));
    },
    'methods': {
        'previewMode'() {
            const _0x3abfb4 = _0x4386fd, _0x56cb65 = {
                    'eadei': function (_0x228c73, _0x579d83) {
                        return _0x228c73(_0x579d83);
                    }
                };
            if (unloaded)
                return;
            _0x56cb65[_0x3abfb4(0x183)](tryShowWindow, -0x1 * -0xf5d + -0x21a + -0x2a7 * 0x5);
        },
        'buildMobileMode'() {
            const _0x551ff6 = _0x4386fd, _0x2508df = {
                    'gmHrg': function (_0x38f210, _0xdfa947) {
                        return _0x38f210(_0xdfa947);
                    }
                };
            if (unloaded)
                return;
            _0x2508df[_0x551ff6(0x16c)](tryShowWindow, 0x651 + -0x599 * -0x1 + 0xbe9 * -0x1);
        },
        'buildDesktopMode'() {
            const _0x2ca701 = _0x4386fd, _0x1f5e77 = {
                    'cZiqy': function (_0x4aa0b4, _0x3a4139) {
                        return _0x4aa0b4(_0x3a4139);
                    }
                };
            if (unloaded)
                return;
            _0x1f5e77[_0x2ca701(0x145)](tryShowWindow, 0xe5d + 0x1377 + 0x1 * -0x21d1);
        },
        'openCustomPage'() {
            const _0x1bb4bf = _0x4386fd, _0x1a1fb4 = {
                    'pEjRA': function (_0xd16034, _0x56fb51) {
                        return _0xd16034(_0x56fb51);
                    }
                };
            if (unloaded)
                return;
            _0x1a1fb4[_0x1bb4bf(0x147)](tryShowWindow, 0x19a8 * -0x1 + -0x1504 + 0x2eae);
        }
    }
};
function focusNode(_0x1f8735, _0x18c5f8) {
    const _0x1e19da = _0x4386fd, _0x3b749f = { 'oBAgH': _0x1e19da(0x191) };
    let _0x199a02 = Editor[_0x1e19da(0x16d)][_0x1e19da(0x159) + 'd'](_0x3b749f[_0x1e19da(0x170)]);
    Editor[_0x1e19da(0x16d)][_0x1e19da(0x144)](_0x3b749f[_0x1e19da(0x170)], _0x199a02), Editor[_0x1e19da(0x16d)][_0x1e19da(0x186)](_0x3b749f[_0x1e19da(0x170)], _0x18c5f8);
}
function focusAsset(_0x144576, _0x3cc217) {
    const _0x28615d = _0x4386fd, _0x26b831 = {
            'vnfCD': _0x28615d(0x176) + _0x28615d(0x180),
            'SCSvp': _0x28615d(0x166)
        };
    Editor[_0x28615d(0x173)][_0x28615d(0x197)](_0x26b831[_0x28615d(0x142)], _0x3cc217);
    let _0x308347 = Editor[_0x28615d(0x16d)][_0x28615d(0x159) + 'd'](_0x26b831[_0x28615d(0x181)]);
    Editor[_0x28615d(0x16d)][_0x28615d(0x144)](_0x26b831[_0x28615d(0x181)], _0x308347), Editor[_0x28615d(0x16d)][_0x28615d(0x186)](_0x26b831[_0x28615d(0x181)], _0x3cc217);
}
async function showWindow() {
    const _0x1730f6 = _0x4386fd, _0x1a81bc = {
            'cERxr': function (_0x3a0ba3, _0x333e60) {
                return _0x3a0ba3 + _0x333e60;
            },
            'egRfC': _0x1730f6(0x19d) + _0x1730f6(0x169),
            'IHhew': _0x1730f6(0x14f),
            'zEqPJ': _0x1730f6(0x17d) + _0x1730f6(0x18f),
            'hUxUn': _0x1730f6(0x190),
            'OjTNI': function (_0x253322, _0x8b92fc) {
                return _0x253322 >= _0x8b92fc;
            },
            'LIPUQ': _0x1730f6(0x146),
            'KULGN': _0x1730f6(0x185),
            'VSdBg': function (_0x1b7652, _0x55d51d) {
                return _0x1b7652 + _0x55d51d;
            },
            'wYLwo': function (_0x262c02, _0xc8471f) {
                return _0x262c02 + _0xc8471f;
            },
            'GrcYt': function (_0x47adac, _0x12a8b7) {
                return _0x47adac + _0x12a8b7;
            },
            'OOEZE': _0x1730f6(0x15a),
            'UTJIn': _0x1730f6(0x14d)
        };
    if (win) {
        win[_0x1730f6(0x178)](), win[_0x1730f6(0x19b) + 's'][_0x1730f6(0x165) + _0x1730f6(0x151)](_0x1730f6(0x157) + _0x1730f6(0x15d) + mode + ')');
        return;
    }
    win = new BrowserWindow({
        'minWidth': 0x36e,
        'minHeight': 0x258,
        'width': 0x36e,
        'height': 0x258,
        'title': _0x1a81bc[_0x1730f6(0x14c)](_0x1a81bc[_0x1730f6(0x174)], PKG_VERSION),
        'backgroundColor': _0x1a81bc[_0x1730f6(0x17f)],
        'useContentSize': ![],
        'webPreferences': {
            'enablePreferredSizeMode': !![],
            'preferredSizeMode': !![],
            'webviewTag': !![],
            'nodeIntegration': !![],
            'nodeIntegrationInSubFrames': !![],
            'enableRemoteModule': !![],
            'sandbox': ![],
            'devTools': devTools,
            'contextIsolation': ![],
            'webSecurity': !disableWebSec,
            'preload': path[_0x1730f6(0x171)](__dirname, folder + (_0x1730f6(0x163) + _0x1730f6(0x192)))
        }
    }), win[_0x1730f6(0x14b)](null), win['on'](_0x1a81bc[_0x1730f6(0x195)], () => win[_0x1730f6(0x178)]()), win['on'](_0x1a81bc[_0x1730f6(0x143)], () => {
        win = null;
    });
    let _0x3c6944 = folder + (_0x1730f6(0x188) + _0x1730f6(0x175) + _0x1730f6(0x149));
    _0x1a81bc[_0x1730f6(0x17b)](process[_0x1730f6(0x18c)][_0x1730f6(0x184)][_0x1730f6(0x164)]('.')[0x20 * 0xc9 + -0xc7b + 0x437 * -0x3], 0x1c2f + -0x1969 * -0x1 + -0x3593) && (_0x3c6944 = folder + _0x1730f6(0x15b));
    let _0x245e50 = await Editor[_0x1730f6(0x173)][_0x1730f6(0x15e)](_0x1a81bc[_0x1730f6(0x194)], _0x1a81bc[_0x1730f6(0x160)]), _0x5c9968 = path[_0x1730f6(0x171)](__dirname, _0x1a81bc[_0x1730f6(0x193)](_0x1a81bc[_0x1730f6(0x179)](_0x1a81bc[_0x1730f6(0x16b)](_0x1a81bc[_0x1730f6(0x16b)](_0x3c6944, _0x1a81bc[_0x1730f6(0x161)]), _0x245e50), _0x1a81bc[_0x1730f6(0x154)]), mode));
    win[_0x1730f6(0x17e)](_0x1730f6(0x162) + _0x5c9968);
}
function tryShowWindow(_0x3d5fcc) {
    const _0x17d9ef = _0x4386fd, _0x9457c3 = {
            'FYVCW': function (_0x14647e) {
                return _0x14647e();
            }
        };
    mode = _0x3d5fcc;
    try {
        _0x9457c3[_0x17d9ef(0x153)](showWindow);
    } catch (_0x4602af) {
        console[_0x17d9ef(0x150)](_0x4602af);
    }
}